package com.ynny.Entity;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
//生成所有参数的构造方法
@AllArgsConstructor
public class R {
    private Integer code;//响应状态码
    private String msg;//响应信息，提示信息
    private Object data;//响应数据，响应体

    public R() {
    }

    public static R ok(Object data) {
        return new R(200, "success", data);
    }
    public static R error(String msg) {
        return new R(211, msg, null);
    }
}
